package com.itheima.mapper;

import com.itheima.entity.Movies;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface MoviesMapper {
    List<Movies> findByPage(Integer cid, String keyword);

    @Select("select * from tb_movies where id = #{id}")
    Movies findById(Integer id);

    void save(Movies movies);

    void update(Movies movies);

    @Delete("delete from tb_movies where id = #{id}")
    void deleteById(Integer id);

    void deleteByIds(Integer[] ids);

    @Select("select * from tb_movies")
    List<Movies> findAll();
}